<template>
  <CloudTreeSelect
    v-model="value1"
    style="width: 300px"
    :treeData="treeData1"
    :defaultExpandAll="true"
    :replace-fields="replaceFields"
  ></CloudTreeSelect>
</template>

<script>

  export default {
    title: '6.自定义TreeNode字段 ',
    subTitle: '设置replaceFields来替换treeNode中 title,key,children字段为treeData中对应的字段',
    data () {
      return {
        value1: undefined,
        replaceFields: {
          children: 'child_list',
          title: 'group_name',
          key: 'group_id',
          value: 'group_id'
        },
        treeData1: [{
          group_name: 123,
          group_id: 123,
          isParent: true,
          child_list: [{
            group_name: 456,
            group_id: 456
          }, {
            group_name: 789,
            group_id: 789
          }, {
            group_name: 111,
            group_id: 111
          }, {
            group_name: 222,
            group_id: 222
          }, {
            group_name: 333,
            group_id: 333
          }]
        }],
      }
    },
    methods: {
    }
  }
</script>

<style lang="scss">
</style>